<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="code," />








  <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico?v=5.1.0" />






<meta name="description" content="Blog-Hexo搭建">
<meta property="og:type" content="article">
<meta property="og:title" content="blog-hexo">
<meta property="og:url" content="www.laipi.win/2016/12/16/blog-hexo/index.html">
<meta property="og:site_name" content="Laipi">
<meta property="og:description" content="Blog-Hexo搭建">
<meta property="og:image" content="http://oitxk7kun.bkt.clouddn.com/image/code/hexo/hexo1.png">
<meta property="og:updated_time" content="2017-01-04T07:28:57.668Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="blog-hexo">
<meta name="twitter:description" content="Blog-Hexo搭建">
<meta name="twitter:image" content="http://oitxk7kun.bkt.clouddn.com/image/code/hexo/hexo1.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="www.laipi.win/2016/12/16/blog-hexo/"/>





  <title> blog-hexo | Laipi </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">Laipi</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
    
      <p class="site-subtitle">摩登探险</p>
    
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-nav">
          <a href="/nav" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-graduation-cap"></i> <br />
            
            导航
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="www.laipi.win/2016/12/16/blog-hexo/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="赖皮">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.png">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Laipi">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Laipi" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                blog-hexo
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2016-12-16T15:56:13+08:00">
                2016-12-16
              </time>
            

            

            
          </span>

          

          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="Blog-Hexo搭建"><a href="#Blog-Hexo搭建" class="headerlink" title="Blog-Hexo搭建"></a>Blog-Hexo搭建</h1><a id="more"></a>
<blockquote>
<p><strong>感谢</strong></p>
<ul>
<li><a href="https://git-scm.com/" target="_blank" rel="external">git</a></li>
<li><a href="https://nodejs.org/en/" target="_blank" rel="external">node.js</a></li>
<li><a href="https://github.com/" target="_blank" rel="external">github</a></li>
<li><a href="https://hexo.io/zh-cn/" target="_blank" rel="external">Hexo框架</a><ul>
<li><a href="http://localhost:4000/" target="_blank" rel="external">localhost:4000</a></li>
<li><a href="http://theme-next.iissnan.com/" target="_blank" rel="external">Next主题</a><ul>
<li><a href="http://laipisong.duoshuo.com/" target="_blank" rel="external">多说评论插件</a></li>
<li><a href="http://www.fontawesome.cn/" target="_blank" rel="external">图标地址</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</blockquote>
<h3 id="Hexo-常用命令"><a href="#Hexo-常用命令" class="headerlink" title="Hexo 常用命令"></a>Hexo 常用命令</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">命令简写：</span><br><span class="line">hexo n == hexo new          新建md文件</span><br><span class="line">hexo g == hexo generate     生成静态网页   </span><br><span class="line">hexo s == hexo server       启动本地服务器</span><br><span class="line">hexo d == hexo deploy       一键部署</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">npm install -g hexo         全局安装Hexo</span><br><span class="line">hexo init                   初始化Hexo环境                 </span><br><span class="line">hexo render                 渲染文件</span><br><span class="line">hexo version                查看版本</span><br><span class="line">hexo list                   列出网站资料</span><br><span class="line">hexo clean                  清除缓存文件 (db.json)和已生成的静态文件 (public)。</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">hexo --safe                 安全模式下，不会载入插件和脚本</span><br><span class="line">hexo --debug                在终端中显示调试信息并记录到 debug.log</span><br><span class="line">hexo --draft                显示 source_drafts 文件夹中的草稿文章</span><br><span class="line">hexo migrate                从其他系统迁移内容</span><br></pre></td></tr></table></figure>
<h3 id="写作相关设置"><a href="#写作相关设置" class="headerlink" title="写作相关设置"></a>写作相关设置</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>
<h3 id="常用配置代码"><a href="#常用配置代码" class="headerlink" title="常用配置代码"></a>常用配置代码</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">Hexo 3.0 把服务器独立成了个别模块，您必须先安装 hexo-server 才能使用。</span><br><span class="line">$ npm install hexo-server --save</span><br><span class="line"></span><br><span class="line">git clone xxxxxxxxxxxxxxxx  粘贴上URL 下载主题到本地文件</span><br><span class="line">npm update -g hexo  使用 npm 命令更新 Hexo</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">安装Next主题</span><br><span class="line">next主题会自动下载到themes目录下。</span><br><span class="line">$ git clone https://github.com/iissnan/hexo-theme-next themes/next</span><br></pre></td></tr></table></figure>
<h3 id="常用配置文件"><a href="#常用配置文件" class="headerlink" title="常用配置文件"></a>常用配置文件</h3><h6 id="配置文件-—-“config-yml”"><a href="#配置文件-—-“config-yml”" class="headerlink" title="配置文件 — “config.yml”"></a>配置文件 — “config.yml”</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line">  type: git</span><br><span class="line">  repository: git@github.com:laipisong/laipisong.github.io.git</span><br><span class="line">  branch: master</span><br></pre></td></tr></table></figure>
<p><img src="http://oitxk7kun.bkt.clouddn.com/image/code/hexo/hexo1.png" alt="hexo1"></p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/code/" rel="tag"># code</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2016/12/24/liwu/" rel="prev" title="hello">
                hello <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.png"
               alt="赖皮" />
          <p class="site-author-name" itemprop="name">赖皮</p>
          <p class="site-description motion-element" itemprop="description">赖床的赖，调皮的皮</p>
        </div>
        <nav class="site-state motion-element">
        
          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">2</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">1</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Blog-Hexo搭建"><span class="nav-number">1.</span> <span class="nav-text">Blog-Hexo搭建</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Hexo-常用命令"><span class="nav-number">1.0.1.</span> <span class="nav-text">Hexo 常用命令</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#写作相关设置"><span class="nav-number">1.0.2.</span> <span class="nav-text">写作相关设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#常用配置代码"><span class="nav-number">1.0.3.</span> <span class="nav-text">常用配置代码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#常用配置文件"><span class="nav-number">1.0.4.</span> <span class="nav-text">常用配置文件</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#配置文件-—-“config-yml”"><span class="nav-number">1.0.4.0.0.1.</span> <span class="nav-text">配置文件 — “config.yml”</span></a></li></ol></li></ol></li></ol></li></ol></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">赖皮</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  



  




	





  




  
  

  

  

  

  


</body>
</html>
